[bugfix] Fix the multi-LoRA issue in Twinkle#24
[bugfix] Fix the multi-LoRA issue in Twinkle#24Jintao-Huang merged 7 commits intomodelscope:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces two main changes to src/mcore_bridge/bridge/gpt_bridge.py. First, it refines the logic for processing PEFT-related state dictionary keys in the _set_module function by adding a check for _adapter_name, ensuring that only keys relevant to the current adapter are processed. Second, it adds a None check for the value v before calling the converter function in export_weights, which improves robustness. There are no review comments to address.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refines the handling of PEFT formats in the GPT bridge by adding specific checks for adapter names in state dict keys and bypassing certain weight transformations when PEFT is active. It also introduces a null check for values during weight export to prevent errors. A review comment suggests improving the robustness of the adapter name replacement logic to prevent accidental corruption of keys where the adapter name might appear as a substring elsewhere in the path.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request refines the handling of PEFT (LoRA) state dictionaries by improving key mapping logic, ensuring adapter-specific keys are correctly identified, and standardizing dot-notation replacements. It also skips conv1d.weight reformatting when in PEFT mode and adds a null check during weight export. Feedback suggests extending the filtering logic for modules_to_save keys to the full model export path to avoid including redundant weights from other adapters.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates gpt_bridge.py to refine state dictionary key handling for PEFT/LoRA adapters, implementing more precise substring matching and conditional processing for attention weights. It also adds a null check in the weight export process. The review feedback highlights that the new dot-delimited matching logic may fail for keys located at the root of the state dictionary, potentially leading to incorrect filtering or the unintended inclusion of internal module weights.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the GPT bridge to improve the handling of PEFT adapter weights, specifically focusing on filtering and renaming keys for LoRA and modules-to-save patterns. It also introduces a check to skip conv1d weight processing when using PEFT formats and adds a null check during weight export. The review feedback highlights that the current string replacement logic for adapter names is too broad and could lead to false positives or corrupted keys in multi-adapter scenarios. It is recommended to use more specific patterns for matching and replacing adapter names to ensure robustness.
No description provided.